/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XPF
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface SportsWeight extends BasicModel<SportsWeight> {
  indexId?: string; // 主键id
  indexType?: string; // 指标分类
  adaptGrade?: string; // 适配年级
  indexName?: string; // 单项指标名称
  indexUnit?: string; // 单项指标单位
  weight?: number; // 权重
  isDelete?: string; // 删除标记
  proposal?: string; // 建议
  customizeIndex?: string; // 是否自定义指标
}

export const sportsWeightList = (params?: SportsWeight | any) =>
  defHttp.get<SportsWeight>({ url: adminPath + '/sports/sportsWeight/list', params });

export const sportsWeightListData = (params?: SportsWeight | any) =>
  defHttp.post<Page<SportsWeight>>({ url: adminPath + '/sports/sportsWeight/listData', params });

export const sportsWeightForm = (params?: SportsWeight | any) =>
  defHttp.get<SportsWeight>({ url: adminPath + '/sports/sportsWeight/form', params });

export const sportsWeightSave = (params?: any, data?: SportsWeight | any) =>
  defHttp.postJson<SportsWeight>({ url: adminPath + '/sports/sportsWeight/save', params, data });

export const selectData = (params?: any, data?: SportsWeight | any) =>
  defHttp.postJson<SportsWeight>({
    url: adminPath + '/sports/sportsWeight/selectData',
    params,
    data,
  });
export const sportsWeightDelete = (params?: SportsWeight | any) =>
  defHttp.get<SportsWeight>({ url: adminPath + '/sports/sportsWeight/delete', params });
